package android.explorer;

import java.io.File;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MusicActivity extends Activity{

	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.musicspace);
		
		Button back = (Button)findViewById(R.id.back);
		back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent home = new Intent(MusicActivity.this, Explorer.class);
				startActivity(home);
			}
		});
		
		Button playMusic = (Button)findViewById(R.id.playmusic);
		playMusic.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent choseMusic = new Intent(Intent.ACTION_VIEW);
				File sdcard = Environment.getExternalStorageDirectory();
				File music = new File(sdcard.getPath()+"/download/phyane.mp3");
				choseMusic.setDataAndType(Uri.fromFile(music), "audio/mp3");
				startActivity(choseMusic);
				
			}
		});
		
		Button musicListButton = (Button)findViewById(R.id.musiclist);
		musicListButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
			}
		});
	}
}
